package sort.comparableindroduce;

public class ComraDemo {

    public static void main(String[] args) {
        Student s1 = new Student("张三", 20);
        Student s2 = new Student("李四", 40);
        Comparable max = getMax(s1, s2);
        System.out.println(max);
    }
    private static Comparable getMax(Comparable c1 , Comparable c2){
        int compare = c1.compareTo(c2);
        if (compare >0){
            return c1;
        }
        else {
            return c2;
        }
    }
}
